package work20241128;

import java.util.Arrays;

/**
 * @author zdl
 * @date 2024/11/28
 */
public class Demo1 {
    public static void main(String[] args) {
        //将一个数组进行反转
        int[] arr = {1, 4, 3, 2};
        int[] newArr = new int[arr.length];
        for (int i = 0, j = arr.length - 1; i < arr.length; i++, j--) {
            newArr[j] = arr[i];
        }
        System.out.println(Arrays.toString(newArr));
    }
}
